<template>
  <el-form inline label-width="auto" size="medium" class="search-form">
    <el-form-item label="总店状态">
      <el-select clearable v-model="search.branchStatus" class="search-input">
        <el-option v-for="item in statusList" :key="item.value" :value="item.value" :label="item.label">
        </el-option>
      </el-select>
    </el-form-item>
    <el-form-item label="分店状态">
      <el-select clearable v-model="search.partnerStatus" class="search-input">
        <el-option v-for="item in statusList" :key="item.value" :value="item.value" :label="item.label">
        </el-option>
      </el-select>
    </el-form-item>
    <el-form-item label="创建日期">
      <el-date-picker clearable v-model="search.startTime" class="search-input" value-format="timestamp" format="yyyy-MM-dd"
        :editable="false" :picker-options="startDateOption"></el-date-picker>
      <span>-</span>
      <el-date-picker clearable v-model="search.endTime" class="search-input" value-format="timestamp" format="yyyy-MM-dd"
        :editable="false" :picker-options="endDateOption"></el-date-picker>
    </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="searchData">查询</el-button>
    </el-form-item>
  </el-form>
</template>

<script>
  import dateTimeMixin from 'mixins/dateTime';

  export default {
    mixins: [dateTimeMixin()],

    props: {
      search: {
        type: Object,
        required: true
      }
    },

    data() {
      return {
        statusList: this.i18n.getDropDown('statistic.status', [1, 0])
      };
    },

    methods: {
      searchData() {
        this.$emit('search-data');
      }
    }
  };

</script>

<style lang="scss" scoped>
  @import '~viewStyle/searchForm';

</style>

<style lang="scss">
  .search-form.el-form--inline .el-form-item:last-child {
    margin-right: 0;
  }

</style>
